home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / machserver / include / user / RCS / rpc.h,v < prev    next >
Encoding:
Text File  |  1992-07-17  |  8.1 KB  |  236 lines

  1. head     1.3;
  2. branch   ;
  3. access   ;
  4. symbols  srv030:1.3 srv027:1.3 srv026:1.3 srv024:1.3 srv021:1.3 srv019:1.3 srv018:1.3 srv016:1.3 srv014:1.3 srv010:1.3 srv008:1.3 srv007:1.3 srv006:1.3 srv005:1.3 srv004:1.3 srv003:1.3 srv002:1.3 srv001:1.3;
  5. locks    ; strict;
  6. comment  @ * @;
  7.  
  8.  
  9. 1.3
  10. date     92.01.21.14.23.43;  author kupfer;  state Exp;
  11. branches ;
  12. next     1.2;
  13.  
  14. 1.2
  15. date     91.11.11.23.09.27;  author kupfer;  state Exp;
  16. branches ;
  17. next     1.1;
  18.  
  19. 1.1
  20. date     91.11.11.00.31.15;  author kupfer;  state Exp;
  21. branches ;
  22. next     ;
  23.  
  24.  
  25. desc
  26. @@
  27.  
  28.  
  29. 1.3
  30. log
  31. @Add timeoutRaces to Rpc_CltStat.
  32. @
  33. text
  34. @/*
  35.  * rpc.h --
  36.  *
  37.  *    User declarations for dealing with the Sprite RPC system.
  38.  *
  39.  * Copyright (C) 1987 Regents of the University of California
  40.  * All rights reserved.
  41.  *
  42.  *
  43.  * $Header: /r3/kupfer/spriteserver/include/user/RCS/rpc.h,v 1.2 91/11/11 23:09:27 kupfer Exp Locker: kupfer $ SPRITE (Berkeley)
  44.  */
  45.  
  46. #ifndef _RPCUSER
  47. #define _RPCUSER
  48.  
  49. #include <cfuncproto.h>
  50. #include <sprite.h>
  51. #include <spriteTime.h>
  52.  
  53. /* 
  54.  * All RPC names should fit in a char array this long (including the 
  55.  * trailing null byte).
  56.  */
  57. #define RPC_MAX_NAME_LENGTH    100
  58.  
  59.  
  60. /*
  61.  * The record counting various RPC client system events.
  62.  */
  63. typedef struct Rpc_CltStat {
  64.         /*
  65.          * Counters incremented during dispatch.
  66.          */
  67.     int toClient;    /* # of packets destined for client side RPC */
  68.     int badChannel;    /* # of packets discarded because of a bad channel */
  69.             /* (toClient - badChannel) msgs passed to dispatch */
  70.     int chanBusy;    /* # of times input was dropped because the channel
  71.              *     it was for was busy, ie. not waiting for input */
  72.     int badId;        /* # of packets discarded because of a bad (old) ID */
  73.         /*
  74.          * requests = replies + aborts
  75.          */
  76.     int requests;    /* # of request messages sent to the server */
  77.     int replies;    /* ... of replies from the server.  Not counting
  78.              *     on going RPCs, the total # of requests should
  79.              *     equal the sum of timeouts, tooManyAcks, errors
  80.              *     and replies. */
  81.     int acks;        /* # of acknowledgment received from the server */
  82.     int recvPartial;    /* # of partial acks received from the server */
  83.     int    nacks;        /* # of negative acknowledgements from the server */
  84.     int    reNacks;    /* # of nacks after first for requests */
  85.     int    maxNacks;    /* # of nacks after setting max backoff wait */
  86.         /*
  87.          * timeouts = resends + aborts + sentPartial
  88.          */
  89.     int timeouts;    /* # of timeouts waiting for a reply message */
  90.     int aborts;        /* # of times an RPC aborted because of timeouts */
  91.     int resends;    /* # of messages resent to the server */
  92.     int sentPartial;    /* # of partial acks sent to the server */
  93.  
  94.     int errors;        /* ... of errors received from the server, these
  95.              *     errors are reflections of errors during
  96.              *     execution of the RPC, or errors during dispatch
  97.              *     of the RPC on the server. */
  98.     int nullErrors;    /* ... of times return error code was null */
  99.     int dupFrag;    /* # of duplicate frags received */
  100.     int close;        /* # of close requests from the server */
  101.  
  102.     int oldInputs;    /* Same as badID, but when recieved by process */
  103.     int badInput;    /* # times received unexpected message type */
  104.     int tooManyAcks;    /* # of times a large number of acks were
  105.              * received while waiting for a reply. Could be
  106.              * incremented more than once per RPC */
  107.     int timeoutRaces;    /* # of responses dropped on the floor because they 
  108.              * didn't quite beat the timeout */
  109.         /*
  110.          * These fields record events related to allocating channels 
  111.          */
  112.     int chanWaits;    /* ... of times a process had to wait for a channel. */
  113.     int chanBroads;    /* ... of times a broadcast was done to wake up
  114.              *     processes waiting for channels. */
  115.     int chanHits;    /* ... of times a channel was reallocated to the same
  116.              *     server. */
  117.     int chanNew;    /* ... indicates how many different channels have been
  118.              *     allocated.  The system tries to allocate a
  119.              *     different channel for different servers.*/
  120.     int chanReuse;    /* ... of times a channel had to allocated for a
  121.              *     server that was different from the one it had
  122.              *     been allocated to before. */
  123.     int    newTrouble;    /* ... of times a server not already ramped down
  124.                    is ramped down by client. */
  125.     int    moreTrouble;    /* ... of times a server already ramped down is again
  126.                    noted as sending nacks. */
  127.     int    endTrouble;    /* ... of times a server previously ramped down is
  128.                    marked as okay again. */
  129.     int    noMark;        /* ... of times there was no room to mark a server
  130.                    as in trouble - too many servers in trouble! */
  131.     int    nackChanWait;    /* ... of waits for busy channel 'cause ramped down. */
  132.         /*
  133.          * These are common to both client-side and server-side
  134.          */
  135.     int paramOverrun;    /* ... of times the parameters were too big */
  136.     int dataOverrun;    /* ... of times the data was too big */
  137.     int shorts;        /* ... of too short packets discarded by Rpc_Dispatch */
  138.     int longs;        /* ... of too long packets trimmed down, Rpc_Dispatch */
  139.  
  140. } Rpc_CltStat;
  141.  
  142. /*
  143.  * The record counting various RPC server system events.
  144.  * 
  145.  * Warning: the kernel routine RpcResetSrvStat relies on the fact that 
  146.  * the stats are an array of ints.
  147.  */
  148. typedef struct Rpc_SrvStat {
  149.     int toServer;    /* # messages to the server half of RPC */
  150.     int noAlloc;    /* # srvr msgs discarded due to no srvr proc avail */
  151.     int    nacks;        /* # neg acks sent */
  152.     int invClient;    /* # srvr msgs discarded from invalid clients */
  153.     int serverBusy;    /* # requests ignored because srvr proc was busy */
  154.             /* Messages passed to RpcServerDispatch is equal to
  155.              * toServer - noAlloc - invClient */
  156.     int requests;    /* # messages that start a new RPC */
  157.     int impAcks;    /* # requests that imp acked previous reply */
  158.     int handoffs;    /* # times complete message handed to srvr proc */
  159.     int fragMsgs;    /* # of packets that were the first fragment of msg */
  160.             /* requests = handoffs + fragMsgs - serverBusy */
  161.     int handoffAcks;    /* # acks sent when handoff occurred */
  162.     int fragAcks;    /* # acks sent when fragment received */
  163.     int sentPartial;    /* # of partial acknowledgments sent */
  164.     int busyAcks;    /* # acks sent when srvr proc was busy with request */
  165.  
  166.     int resends;    /* # of reply messages that were resent */
  167.     int badState;    /* # msgs ignored because srvr in unexpected state */
  168.     int extra;        /* # msgs ignored because srvr was SRV_FREE */
  169.     int reclaims;    /* # times a server process was forcibly reclaimed
  170.              *     from an unreachable client */
  171.     int reassembly;    /* # of packets that were reassembled */
  172.             /* Total number of fragments received is the sum of
  173.              * fragMsgs + dupFrag + reassembly */
  174.     int dupFrag;    /* # duplicate fragments received */
  175.     int nonFrag;    /* # nonFrag msgs ignored when srvr was SRV_FRAGMENT */
  176.     int fragAborts;    /* # requests that aborted previous frag assembly */
  177.  
  178.     int recvPartial;    /* # of partial acks received */
  179.     int closeAcks;    /* # acks that close a connection, RPC_CLOSE */
  180.     int discards;    /* # broadcasts discarded because of SRV_NO_REPLY */
  181.     int unknownAcks;    /* # of unexpected types of acks */
  182.     int mostNackBuffers;/* high-water mark of nack buffers used */
  183.     int selfNacks;    /* # of nacks we tried to send ourselves */
  184. } Rpc_SrvStat;
  185.  
  186.  
  187. /*
  188.  * Commands for the Test_Rpc system call.
  189.  *    This is invoked via
  190.  *        status = Test_Rpc(command, argPtr);
  191.  */
  192.  
  193. #define TEST_RPC_ECHO    1
  194. #define TEST_RPC_SEND    2
  195. #define TEST_RPC_BOUNCE    3
  196.  
  197. typedef struct Rpc_EchoArgs {
  198.     int serverID;        /* Sprite host ID of echo target */
  199.     int n;            /* Number of repetitions */
  200.     int size;            /* Size of packet, up to 16 K bytes */
  201.     Address inDataPtr;        /* Pointer to send buffer */
  202.     Address outDataPtr;        /* Pointer to receive buffer */
  203.     Time *deltaTimePtr;        /* Elapsed time of all n tests */
  204. } Rpc_EchoArgs;
  205.  
  206.  
  207. extern void Rpc_GetName _ARGS_ ((int rpcNum, int resultLen, char *resultPtr));
  208. extern ReturnStatus Test_Rpc _ARGS_ ((int command, Address argPtr));
  209.  
  210. #endif /* _RPCUSER */
  211. @
  212.  
  213.  
  214. 1.2
  215. log
  216. @Add Test_Rpc.
  217. @
  218. text
  219. @d10 1
  220. a10 1
  221.  * $Header: /r3/kupfer/spriteserver/include/user/RCS/rpc.h,v 1.1 91/11/11 00:31:15 kupfer Exp Locker: kupfer $ SPRITE (Berkeley)
  222. d74 2
  223. @
  224.  
  225.  
  226. 1.1
  227. log
  228. @Initial revision
  229. @
  230. text
  231. @d10 1
  232. a10 1
  233.  * $Header: /sprite/src/lib/include/RCS/rpc.h,v 1.8 91/05/30 13:12:56 jhh Exp $ SPRITE (Berkeley)
  234. d173 1
  235. @
  236.